package cn.toys.base.exception;

import cn.stylefeng.roses.kernel.model.response.ResponseData;
import lombok.Data;

import java.io.Serializable;



@Data
public class Result implements Serializable {
    public final static Result SUCCESS = new Result(ResponseData.DEFAULT_SUCCESS_CODE, "成功");
    public final static Result SYS_ERROR = new Result(ResponseData.DEFAULT_ERROR_CODE, "失败");

    private Integer code = ResponseData.DEFAULT_SUCCESS_CODE;
    private String msg = "成功";

    /**
     * Result构造函数

     * @param code
     * @param msg
     */
    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }




    public Result(Result result) {
        this.code = result.getCode();
        this.msg = result.getMsg();
    }

}
